package com.xiaoma.pattern.proxy.pre;

import org.junit.Test;

import java.lang.reflect.Proxy;

/*
https://cloud.tencent.com/developer/article/1659579
 */
public class DynamicTest {

    @Test
    public void test(){
        HelloWorldSubject subject = new HelloWorldSubject();
        Subject instance = (Subject) Proxy.newProxyInstance(this.getClass().getClassLoader(), HelloWorldSubject.class.getInterfaces(), new JdbcDynamicalProxy(subject));
        instance.print();
    }
}
